<?php

	$id = request('id',false,true);
	$pid = request('pid',false,true,false,94);
	require_once $_site->get_handlepath('info');
	$title="项目展示";
	require_once $_site->get_viewpath("wap/commom/header");

	$type = request('type',false,true,false,1);
	$typeval=array(1=>'菜品展示',2=>'形象案例',3=>'店面展示');
	$hover[$type] = "class='hover'";
	$page = request('page',false,true,false,1);
	require_once $_site->get_handlepath('pic');
	if(!$id){
		switch ($type){
		case 1:

			//二级分类
/**
			$nav_sec = pic_fun_pic_cat_list(array('state'=>0,'pid'=>86));
			foreach($nav_sec as $v){
				$ids.=$v['id'].",";
			}			
			$ids = trim($ids,",");**/
		        $ids='87,88,89,90';
			$res = pic_fun_pic_list(array('cids'=>$ids,'topnumber'=>1),$page,5);

			$urlparam = '/wap/project&type='.$type;
			$pagination = "<span><font style='color:red'>$page</font>/{$res['page_count']}</span>".page_method($res['row_count'],$page,$res['page_count'],0,$urlparam,false);
		break;
		case 2:



		break;
		case 3:

			//二级分类
			/**
			$nav_sec = pic_fun_pic_cat_list(array('state'=>0,'pid'=>27));
			foreach($nav_sec as $v){
				$ids.=$v['id'].",";
			}
			$ids = trim($ids,",");
			**/
			$ids = '133' ;
			$res = pic_fun_pic_list(array('cids'=>$ids,'topnumber'=>1),$page,5);
			$urlparam = '/wap/project&type='.$type;
			$pagination = "<span><font style='color:red'>$page</font>/{$res['page_count']}</span>".page_method($res['row_count'],$page,$res['page_count'],0,$urlparam,false);

		break;
		default:

	}
	}else{
		$content=pic_fun_get_pic_by_id($id);
	}
?>
<body style=" padding-bottom:110px; background: #ffffff;">
	<div class="top"><a href="/wap/index" class="icon_house house" style="right:-92%;"></a><a href="<?php echo $id?"javascript:window.history.go(-1);":'/wap/index';?>" class="arrow_carrot-left return"></a>项目展示</div>

	<div class="jm_top_two">
	<ul>
		<li class="bo_two"><a <?php echo $hover[1];?> href="/wap/project&type=1"><?php echo $typeval[1];?></a></li>
		<!--<li class="bo_two"><a <?php echo $hover[2];?> href="/wap/project&type=2"><?php echo $typeval[2];?></a></li>-->
		<li class="bo_two"><a <?php echo $hover[3];?> href="/wap/project&type=3"><?php echo $typeval[3];?></a></li>
	</ul>
		</div>
	<div class="jm_src add">项目展示 - <span><?php echo $typeval[$type];?></span> <?php echo $content['title']?" - ".$content['title']:'';?></div>
	<div class="<?php echo $id?"jm_list":"pic_list";?>">
		<?php
			if($id){				
				echo "<img src='{$content['indexpicurl']}'>";
			}else{
			?>

				<?php
					if(is_array($res['rows'])){
						echo "<ul>";
						foreach ($res['rows'] as $v){
							$thumb = img_thumb($v['indexpicurl'],'400x267');
							echo"
								<li>
									<em><a href='/wap/project&id={$v['id']}&pid={$pid}&type={$type}'><img src='{$thumb}'></a></em>
									<p>".subs($v['title'],20)."</p>
								</li>
							";
						}
						echo "</ul>";
						?>
						<div class="page">
	<?php echo $pagination ?>
</div>
						<?php
					}else{
						echo"<li class='no_info'>暂无加盟信息！</li>";
					}
				?>
			</ul>

			<?php
			}
		?>

	</div>

	<?php require_once $_site->get_viewpath("wap/commom/footer");?>
</body>
</html>
